cmake_minimum_required(VERSION 3.16)

# 定义项目名称和版本
project(DataStructuresCPP VERSION 1.0 LANGUAGE CXX)

# 设置c++标准
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if(GCC)
    add_compile_options(/W4 /permissive-)
else()
    add_compile_options(-Wall -Wextra -pedaantic)
endif()

# 指定头文件目录
include_directories(${PROJECT_SOURCE_DIR}/include)

# 把src目录里的所有cpp文件放入一个变量中
file(GLOB SOURCES "src/*.cpp")

# 添加可执行文件，名字叫data_structures_app
add_executable(data_structures_app ${SOURCES})

# 让编译器也能找到 include 目录的头文件（针对可执行文件）
target_include_directories(data_structures_app PRIVATE ${PROJECT_SOURCE_DIR}/include)